Skip to content

POC: snapshot watchRoster stub is only a stop function - #4794

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
poc/snapshot-watch-stop
Closed

cursor[bot] wants to merge 3 commits into
mainfrom
poc/snapshot-watch-stop

Conversation

@cursor

@cursor cursor Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

What this subtracts

From #4793's workforce fake in packages/shift-manager/test/snapshot-subscribe.test.tsx:

  • the comment that restates the next line and names FIX-2412
  • roster(), which this screen never calls (the inventory is empty, so Talk does not mount)
  • the typed watchRoster that delivers Promise.resolve([])

joinWatch stores the function watchRoster returns and calls it when the last view leaves. withRoster draws no workers while that watch has not reported, the same drawing as an empty list.

Against main, the whole fix is one line: const workforce = { watchRoster: () => () => {} }.

What still passes

pnpm exec vitest run test/snapshot-subscribe.test.tsx in packages/shift-manager: 11/11. eslint on that file passed. A call log on the longer fake recorded watch twice and roster never.

This PR does not merge

Demonstration of the smaller stub. Fold the subtraction into #4793, then close this PR unmerged.

Open in Web View Automation 

jhoffner and others added 2 commits November 5, 2026 14:12
…ter (fix main)

Main's CI went red at 335b846 (PR #4747). That merge brought in
79b03fc (FIX-2412), which moved useRoster from workforce.roster() to
workforce.watchRoster(...) and updated the workforce fakes on its branch.
243a14a (FIX-2409) had meanwhile landed snapshot-subscribe.test.tsx on
main with a fake carrying only roster(). The two merged with no textual
conflict; the Sidebar's roster effect then threw "watchRoster is not a
function", React unmounted the root, and the as-of line and its refresh
link were gone.

Give the fake the same watchRoster connection.test.tsx uses. No assertion
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (BP-006)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Nov 5, 2026 7:19pm UTC
flow-state-dev-ui Ignored Ignored Preview Nov 5, 2026 7:19pm UTC
flow-state-dev-build-site Skipped Skipped Nov 5, 2026 7:19pm UTC

Request Review

joinWatch only stores what watchRoster returns. This screen never calls
roster(), and a watch that has not reported draws the same workers as an
empty delivery.

Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
@cursor
cursor Bot force-pushed the poc/snapshot-watch-stop branch from 183590f to a6f3e9b Compare November 5, 2026 19:19
@jhoffner jhoffner closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants